<?php
/**
 * 商户验证器
 */

namespace app\common\validate;

class ShopValidate extends CommonBaseValidate
{
    protected $rule = [
            'user_id|用户' => 'require',
    'shop_cate_id|商户分类' => 'require',
    'name|名称' => 'require',
    'service|服务' => 'require',
    'desc|描述' => 'require',
    'tag|标签' => 'require',
    'cover|封面' => 'require',
    'images|图片' => 'require',
    'mobile|联系电话' => 'require',
    'address|地址' => 'require',
    'business_hours|营业时间' => 'require',
    'status|状态' => 'require',
    'top|是否置顶' => 'require',
    'sort|排序' => 'require',

    ];

    protected $message = [
            'user_id.required' => '用户不能为空',
    'shop_cate_id.required' => '商户分类不能为空',
    'name.required' => '名称不能为空',
    'service.required' => '服务不能为空',
    'desc.required' => '描述不能为空',
    'tag.required' => '标签不能为空',
    'cover.required' => '封面不能为空',
    'images.required' => '图片不能为空',
    'mobile.required' => '联系电话不能为空',
    'address.required' => '地址不能为空',
    'business_hours.required' => '营业时间不能为空',
    'status.required' => '状态不能为空',
    'top.required' => '是否置顶不能为空',
    'sort.required' => '排序不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['user_id', 'shop_cate_id', 'name', 'service', 'desc', 'tag', 'shopid', 'cover', 'images', 'mobile', 'address', 'lng', 'business_hours', 'status', 'top', 'sort', ],
        'admin_edit'    => ['id', 'user_id', 'shop_cate_id', 'name', 'service', 'desc', 'tag', 'shopid', 'cover', 'images', 'mobile', 'address', 'lng', 'business_hours', 'status', 'top', 'sort', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['user_id', 'shop_cate_id', 'name', 'service', 'desc', 'tag', 'shopid', 'cover', 'images', 'mobile', 'address', 'lng', 'business_hours', 'status', 'top', 'sort', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'user_id', 'shop_cate_id', 'name', 'service', 'desc', 'tag', 'shopid', 'cover', 'images', 'mobile', 'address', 'lng', 'business_hours', 'status', 'top', 'sort', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
